package stat

type ValueType string

const (
	Count       ValueType = "count"
	Cardinality ValueType = "cardinality"
	Mean        ValueType = "mean"
)

type MenuQueryInfo struct {
	Key       string    `json:"key"`
	ValueType ValueType `json:"value_type"`
}

type MenuInfo struct {
	Type      string          `json:"type"`
	Query     string          `json:"query"`
	Field     string          `json:"field"`
	QueryInfo []MenuQueryInfo `json:"query_info"`
}

var Menus = []MenuInfo{
	{
		Type:  "finish_jigsaw",
		Query: "message:\"完成拼图\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天拼图完成数(所有图)",
				ValueType: Count,
			}, {
				Key:       "每天拼图完成人数(所有图)（去重后）",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "unlock_jigsaw",
		Query: "message:\"解锁拼图\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天拼图解锁人数(所有图)",
				ValueType: Count,
			}, {
				Key:       "每天拼图解锁人数(所有图)（去重后）",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "finish_custom_pic",
		Query: "message:\"完成拼图\" AND menuId: 1000000",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天拼图完成数(拼图圈的图)",
				ValueType: Count,
			},
			{
				Key:       "每天拼图完成人数(拼图圈的图)（去重后）",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "unlock_custom_pic",
		Query: "message:\"解锁拼图\" AND menuId: 1000000",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天拼图解锁人数(拼图圈的图)",
				ValueType: Count,
			},
			{
				Key:       "每天拼图解锁人数(拼图圈的图)（去重后）",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "finish_and_share",
		Query: "message:\"完成并分享拼图\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天卡包分享人数",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "got_free_grass_double",
		Query: "message:\"领取免费四叶草\" AND isShare:true",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天双倍领取免费四叶草人数",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "got_free_grass",
		Query: "message:\"领取免费四叶草\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天领取四叶草人数",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "login",
		Query: "message:\"登录\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天登录游戏人数",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "invite",
		Query: "message:\"邀请\" AND NOT message:\"领取邀请奖励\"",
		Field: "invitee",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天邀请人数",
				ValueType: Count,
			},
		},
	},
	{
		Type:  "got_invite_reward",
		Query: "message:\"领取邀请奖励\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天领取邀请奖励人数",
				ValueType: Count,
			},
			{
				Key:       "每天领取邀请奖励人数（去重后）",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "got_video_reward",
		Query: "message:\"领取看视频奖励\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天领取视频奖励数",
				ValueType: Count,
			},
			{
				Key:       "每天领取视频奖励人数（去重后）",
				ValueType: Cardinality,
			},
		},
	},
	{
		Type:  "register",
		Query: "message:\"新用户注册\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天新注册人数",
				ValueType: Count,
			},
		},
	},
	{
		Type:  "upload_pic",
		Query: "message:\"上传图片\"",
		Field: "playerId",
		QueryInfo: []MenuQueryInfo{
			{
				Key:       "每天上传图片数",
				ValueType: Count,
			},
			{
				Key:       "每天上传图片数（去重后）",
				ValueType: Cardinality,
			},
		},
	},
}
